package com.myedu.tankgame02;

/**
 * @author Little fat D
 * @version 1.0
 * 玩家的坦克
 */
public class Hero extends Tank {
    private Shot shot = null;

    public Hero(int x, int y) {
        super(x, y);
    }

    public void shotEnemyTank() {
        switch (getDirect()) {
            case 0:
                shot = new Shot(getX(), getY() - 30, getDirect());
                break;
            case 1:
                shot = new Shot(getX() + 30, getY(), getDirect());
                break;
            case 2:
                shot = new Shot(getX(), getY() + 30, getDirect());
                break;
            case 3:
                shot = new Shot(getX() - 30, getY(), getDirect());
                break;
        }
        new Thread(shot).start();
    }

    public Shot getShot() {
        return shot;
    }
}
